//
//  WebViewController.m
//  IT爱好者
//
//  Created by dllo on 15/10/17.
//  Copyright © 2015年 Fan. All rights reserved.
//

#import "WebViewController.h"
#import "Header.h"
@interface WebViewController ()<UIWebViewDelegate>
@property(nonatomic, retain)UIActivityIndicatorView *activityView;
@end

@implementation WebViewController

-(void)viewWillAppear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden = YES;
    
}
-(void)viewWillDisappear:(BOOL)animated
{
    self.tabBarController.tabBar.hidden = NO;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.activityView = [[UIActivityIndicatorView alloc]initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleGray];
    _activityView.center = self.view.center;
    
    [self.navigationController.navigationBar setTintColor:[UIColor whiteColor]];
    self.view.backgroundColor = [UIColor whiteColor];
    UIWebView *webView = [[UIWebView alloc]initWithFrame:CGRectMake(0, -90, ScreenWidth, ScreenHeight + 165)];
    webView.scrollView.bounces = NO;
    webView.delegate = self;
    NSString *urlString = [NSString stringWithFormat:@"http://wap.zol.com.cn/369/%@/index.html", _Id];
    NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:[NSURL URLWithString:urlString]];
    [webView loadRequest:request];
    [self.view addSubview:webView];
    [self.view addSubview:_activityView];
}

-(void)webViewDidStartLoad:(UIWebView *)webView
{
    [_activityView startAnimating];
}

-(void)webViewDidFinishLoad:(UIWebView *)webView
{
    [_activityView stopAnimating];
}




- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
